I was seeing if a wasteful solution could work for rate and accidentally solved for the other metric. I'm sure it can be improved, but week 6 is up and I haven't even looked at it; I'm leaving it here.